#include "FrequencyBuilder.h"

FrequencyBuilder::FrequencyBuilder()  {}

void FrequencyBuilder::build(IDataReader* reader)
{
	while(!reader->isEnd())
	{
		_frequencies.increment(reader->getChar());
	}
	reader->reflesh();
}

IFrequencyTable* FrequencyBuilder::getFrequencyTable()
{
	return &_frequencies;
}

void FrequencyBuilder::reset()
{
	_frequencies.reset();
}